lithuanian_missions_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		NOT = { has_dlc = "Lions of the North" }
	}
	potential = {
		tag = LIT
		NOT = { map_setup = map_setup_random }
		NOT = { has_dlc = "Lions of the North" }
	}
	has_country_shield = yes
	
	develop_ukraine_1 = {
		icon = mission_colonial
		required_missions = {  }
		provinces_to_highlight = {
			region = ruthenia_region
			NOT = {
				development = 10
			}
		}
		trigger = {
			num_of_owned_provinces_with = {
				region = ruthenia_region
				development = 10
				value = 10
			}
		}
		effect = {
			ruthenia_region = {
				limit = { owned_by = root }
				add_province_modifier = {
					name = restored_ruthenia
					duration = -1
				}
			}
		}
	}
	lit_religious_unity = {
		icon = mission_luther_theses
		required_missions = { develop_ukraine_1 }
		trigger = {
			NOT = { current_age = age_of_discovery }
			NOT = { current_age = age_of_reformation }
			religious_unity = 1
		}
		effect = {
			if = {
				limit = {
					num_of_owned_provinces_with = {
						religion_group = ROOT
						NOT = { religion = ROOT }
						value = 20
					}
				}
				define_advisor = {
					culture = lithuanian
					type = theologian
					skill = 3
					cost_multiplier = 0.5
				}
				add_country_modifier = {
					name = "lit_conferedation_on_religion"
					duration = 7300
				}
			}
			else = {
				add_country_modifier = {
					name = "lithuanian_counter_reformation"
					duration = 7300
				}
				define_advisor = {
					culture = lithuanian
					type = inquisitor
					skill = 3
					cost_multiplier = 0.25
				}
			}
		}
	}
	lit_ukraine_2 = {
		icon = mission_eastern_european_city
		required_missions = { lit_religious_unity }
		provinces_to_highlight = {
			province_id = 280
		}
		trigger = {
			280 = {
				development = 20
			}
			if = {
				limit = {
					has_dlc = "Dharma"
				}
				280 = {
					province_has_center_of_trade_of_level = 3
				}
			}
			else = {
				280 = {
					OR = {
						has_building = trade_depot
						has_building = stock_exchange
					}
				}
			}
		}
		effect = {
			280 = {
				add_province_modifier = {
					name = "restoration_of_kiev"
					duration = -1
				}
			}
		}
	}
	lit_develop_sluck = {
		icon = mission_noble_council
		required_missions = { lit_ukraine_2 }
		provinces_to_highlight = {
			province_id = 4545
			NOT = {
				OR = {
					has_building = counting_house
					has_building = workshop
				}
			}
		}
		trigger = {
			4545 = {
				has_building = textile
				OR = {
					has_building = counting_house
					has_building = workshop
				}
			}
			textile = 5
		}
		effect = {
			if = {
				limit = {
					has_estate = estate_nobles
				}
				add_estate_loyalty = {
					estate = estate_nobles
					loyalty = 15
				}
			}
			4545 = {
				add_base_production = 3
				add_province_modifier = {
					name = "sluck_sashes"
					duration = -1
				}
			}
		}
	}
}

lithuanian_missions_2 = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		NOT = { has_dlc = "Lions of the North" }
	}
	potential = {
		tag = LIT
		NOT = { map_setup = map_setup_random }
		NOT = { has_dlc = "Lions of the North" }
	}
	has_country_shield = yes
	
	mission_lit_polish_union = {
		icon = mission_monarch_in_throne_room
		required_missions = { defeat_the_livonian_order }
		position = 6
		provinces_to_highlight = {
			OR = {
				area = malopolska_area
				area = mazovia_area
				area = west_prussia_area
			}
			NOT = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		trigger = {
			OR = {
				tag = PLC
				POL = {
					is_subject_of = ROOT
				}
				AND = {
					malopolska_area = {
						type = all
						country_or_non_sovereign_subject_holds = ROOT
					}
					mazovia_area = {
						type = all
						country_or_non_sovereign_subject_holds = ROOT
					}
					west_prussia_area = {
						type = all
						country_or_non_sovereign_subject_holds = ROOT
					}
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = "integrated_polish_nobility"
				duration = -1
			}
		}
	}
	lit_jag_university = {
		icon = mission_early_modern_university
		required_missions = { mission_lit_polish_union }
		provinces_to_highlight = {
			province_id = 262
			NOT = {
				AND = {
					country_or_non_sovereign_subject_holds = ROOT
					has_building = university
				}
			}
		}
		trigger = {
			owns_core_province = 262
			262 = {
				has_building = university
			}
			university = 5
			has_institution = printing_press
		}
		effect = {
			add_prestige = 10
			add_country_modifier = {
				name = "renovated_jag_uni"
				duration = 7300
			}
		}
	}
}

lithuanian_missions_slot = { 
	slot = 5
	generic = no
	ai = no # independent lithuania path not for ai
	potential_on_load = {
		NOT = { has_dlc = "Lions of the North" }
	}
	potential = {
		tag = LIT
		NOT = { map_setup = map_setup_random }
		NOT = { has_dlc = "Lions of the North" }
	}
	has_country_shield = yes
	
	mission_lit_cossacks = {
		icon = mission_cossack_cavalry
		required_missions = {  }
		provinces_to_highlight = {
			OR = {
				province_id = 282
				province_id = 2406
				province_id = 283
			}
		}
		trigger = {
			is_subject = no
			if = {
				limit = {
					has_estate = estate_cossacks
				}
				estate_loyalty = {
					estate = estate_cossacks
					loyalty = 60
				}
				estate_influence = {
					estate = estate_cossacks
					influence = 40
				}
				has_estate_privilege = estate_cossacks_establish_the_cossack_regiments
				owns_core_province = 282
				owns_core_province = 2406
				owns_core_province = 283
			}
			else = {
				282 = {
					owned_by = ROOT
					is_state = yes
					NOT = {
						unrest = 1
					}
					NOT = {
						local_autonomy = 30
					}
				}
				2406 = {
					owned_by = ROOT
					is_state = yes
					NOT = {
						unrest = 1
					}
					NOT = {
						local_autonomy = 30
					}
				}
				283 = {
					owned_by = ROOT
					is_state = yes
					NOT = {
						unrest = 1
					}
					NOT = {
						local_autonomy = 30
					}
				}
			}
		}
		effect = {
			zaporizhia_area = {
				limit = {
					NOT = { is_permanent_claim = ROOT	}
					NOT = { is_core = ROOT	}
				}
				add_permanent_claim = ROOT
			}
			yedisan_area = {
				limit = {
					NOT = { is_permanent_claim = ROOT	}
					NOT = { is_core = ROOT	}
				}
				add_permanent_claim = ROOT
			}
			crimea_area = {
				limit = {
					NOT = { is_permanent_claim = ROOT	}
					NOT = { is_core = ROOT	}
				}
				add_permanent_claim = ROOT
			}
			azov_area = {
				limit = {
					NOT = { is_permanent_claim = ROOT	}
					NOT = { is_core = ROOT	}
				}
				add_permanent_claim = ROOT
			}
		}
	}
	lit_conquer_crimea = {
		icon = mission_crusade_for_varna
		required_missions = { mission_lit_cossacks }
		provinces_to_highlight = {
			OR = {
				area = zaporizhia_area
				area = yedisan_area
				area = crimea_area
				area = azov_area
			}
			NOT = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		trigger = {
			zaporizhia_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT	
			}
			yedisan_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT	
			}
			crimea_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT	
			}
			azov_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT	
			}
			owns_core_province = 285
		}
		effect = {
			add_mercantilism = 2
			if = {
				limit = {
					has_dlc = "Dharma"
					285 = {
						NOT = {
							province_has_center_of_trade_of_level = 3
						}
					}
				}
				285 = {
					add_center_of_trade_level = 1
				}
			}
			else = {
				285 = {
					add_trade_modifier = {
						who = root
						duration = 7300
						power = 50
						key = crimean_trade
					}
				}
			}
		}
	}
	
	polish_alliance_lit = {
		icon = mission_noble_council
		required_missions = {  }
		trigger = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = plc_election_mission_tooltip
					has_global_flag = plc_union_outcome_flag
				}
				is_year = 1450
			}
			is_subject = no
			OR = {
				is_rival = POL
				POL = { is_rival = ROOT }
				alliance_with = POL
				NOT = { exists = POL }
			}
		}
		effect = {
			livonia_area = {
				limit = {
					NOT = { is_permanent_claim = ROOT	}
					NOT = { is_core = ROOT	}
				}
				add_permanent_claim = ROOT
			}
			estonia_ingria_area = {
				limit = {
					NOT = { is_permanent_claim = ROOT	}
					NOT = { is_core = ROOT	}
				}
				add_permanent_claim = ROOT
			}
			curonia_area = {
				limit = {
					NOT = { is_permanent_claim = ROOT	}
					NOT = { is_core = ROOT	}
				}
				add_permanent_claim = ROOT
			}
		}
	}

	defeat_the_livonian_order = {
		icon = mission_teutonic_knights
		required_missions = { polish_alliance_lit }
		position = 5
		provinces_to_highlight = {
			OR = {
				area = livonia_area
				area = estonia_ingria_area
				area = curonia_area
			}
			NOT = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		trigger = {
			livonia_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT	
			}
			estonia_ingria_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT	
			}
			curonia_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT	
			}
		}
		effect = {		
			add_country_modifier = {
				name = "baltic_ambition_new"
				duration = 7300
			}
			if = {
				limit = {
					exists = POL
					valid_for_personal_unions_trigger = yes
					POL = {
						is_subject = no
						government = monarchy
					}
				}
				add_casus_belli = {
					type = cb_restore_personal_union
					months = 300
					target = POL
				}
			}
			else = {
				malopolska_area = {
					limit = {
						NOT = { is_permanent_claim = ROOT }
						NOT = { is_core = ROOT	}
					}
					add_permanent_claim = ROOT
				}
				mazovia_area = {
					limit = {
						NOT = { is_permanent_claim = ROOT }
						NOT = { is_core = ROOT	}
					}
					add_permanent_claim = ROOT
				}
				west_prussia_area = {
					limit = {
						NOT = { is_permanent_claim = ROOT }
						NOT = { is_core = ROOT	}
					}
					add_permanent_claim = ROOT
				}
			}
			if = {
				limit =  {
					NOT = {
						NOV = {
							OR = {
								alliance_with = ROOT
								is_subject_of = ROOT
							}
						}
					}
				}
				novgorod_area = {
					limit = {
						NOT = { is_permanent_claim = ROOT }
						NOT = { is_core = ROOT	}
					}
					add_permanent_claim = ROOT
				}
			}
		}
	}
	lit_conquer_novgorod = {
		icon = mission_assemble_an_army
		required_missions = { defeat_the_livonian_order }
		provinces_to_highlight = {
			area = novgorod_area
			NOT = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		trigger = {
			OR = {
				novgorod_area = {
					type = all
					country_or_non_sovereign_subject_holds = ROOT	
				}
				NOV = {
					OR = {
						alliance_with = ROOT
						is_subject_of = ROOT
					}
					total_development = 150
				}
			}
		}
		effect = {
			if = {
				limit = {
					exists = RUS
					valid_for_personal_unions_trigger = yes
					RUS = {
						valid_for_personal_unions_trigger = yes
					}
				}
				add_casus_belli = {
					type = cb_restore_personal_union
					months = 300
					target = RUS
				}
			}
			else_if = {
				limit = {
					exists = MOS
					valid_for_personal_unions_trigger = yes
					MOS = {
						valid_for_personal_unions_trigger = yes
					}
				}
				add_casus_belli = {
					type = cb_restore_personal_union
					months = 300
					target = MOS
				}
			}
			else = {
				moscow_area = {
					limit = {
						NOT = { is_permanent_claim = ROOT }
						NOT = { is_core = ROOT	}
					}
					add_permanent_claim = ROOT
				}
				oka_area = {
					limit = {
						NOT = { is_permanent_claim = ROOT }
						NOT = { is_core = ROOT	}
					}
					add_permanent_claim = ROOT
				}
				vladimir_area = {
					limit = {
						NOT = { is_permanent_claim = ROOT }
						NOT = { is_core = ROOT	}
					}
					add_permanent_claim = ROOT
				}
				suzdal_area = {
					limit = {
						NOT = { is_permanent_claim = ROOT }
						NOT = { is_core = ROOT	}
					}
					add_permanent_claim = ROOT
				}
				ryazan_area = {
					limit = {
						NOT = { is_permanent_claim = ROOT }
						NOT = { is_core = ROOT	}
					}
					add_permanent_claim = ROOT
				}
			}
		}
	}
	lit_conquer_muscovy = {
		icon = mission_conquer_5_states
		required_missions = { lit_conquer_novgorod }
		provinces_to_highlight = {
			OR = {
				area = moscow_area
				area = oka_area
				area = vladimir_area
				area = suzdal_area
				area = ryazan_area
			}
			NOT = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		}
		trigger = {
			moscow_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT	
			}
			oka_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT	
			}			
			vladimir_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT	
			}
			suzdal_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT	
			}
			ryazan_area = {
				type = all
				country_or_non_sovereign_subject_holds = ROOT	
			}
		}
		effect = {
			add_mil_power = 100
			if = {
				limit = {
					RUS = {
						is_subject_of = ROOT
						is_lesser_in_union = no
					}
				}
				RUS = {
					define_ruler = {
						name = "00000H&"
					}
				}
			}
			else_if = {
				limit = {
					MOS = {
						is_subject_of = ROOT
						is_lesser_in_union = no
					}
				}
				MOS = {
					define_ruler = {
						name = "00000H&"
					}
				}
			}
			if = {
				limit = {
					OR = {
						MOS = {
							is_subject_of = ROOT
						}
						RUS = {
							is_subject_of = ROOT
						}
					}
				}
				add_country_modifier = {
					name = "lit_lord_of_the_rus"
					duration = 7300
				}
			}
			else = {
				add_country_modifier = {
					name = "lit_conquered_rus"
					duration = 7300
				}
			}
		}
	}
}